#define DEBUG
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;

const int maxn=100000, maxx=1000000000;

class Hash {
public:
  static const int mods=1000033;
  ll k[mods];
  bool book[mods];

  void ins(ll tx, ll ty) {
    ll key = tx*2*maxx+ty;
    int p = (key%mods+mods)%mods;
    for (; book[p]; p=(p+1)%mods) {
      if (k[p]==key) {
	return;
      }
    }
    k[p] = key, book[p] = true;
  }

  bool has(ll tx, ll ty) {
    ll key = tx*2*maxx+ty;
    int p = (key%mods+mods)%mods;
    for (; book[p]; p=(p+1)%mods) {
      if (k[p]==key) {
	return true;
      }
    }
    return false;
  }
};

class Point {
public:
  int x, y;

  static bool cmp(Point &a, Point &b) {
    return a.x<b.x || (a.x==b.x && a.y<b.y);
  }
};

int count(ll tx, ll ty, int n, Point ps[], Hash &p) {
  int cnt=0;
  for (int i=1; i<=n; i++) {
    cnt += !p.has(tx-ps[i].x, ty-ps[i].y);
  }
  return cnt;
}

int main() {
  freopen("chess.in", "r", stdin);
  freopen("chess.out", "w", stdout);

  static Hash p, np;
  Point ps[maxn+1];
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i=1; i<=n; i++) {
    scanf("%d %d", &ps[i].x, &ps[i].y);
    p.ins(ps[i].x, ps[i].y);
  }
  sort(ps+1, ps+n+1, Point::cmp);

  if (n<=k) {
    printf("-1");
    return 0;
  }
  ll ans=0;
  for (int i=1; i<=k+1; i++) {
    for (int j=n; i-1+n-j<=k; j--) {
      ll tx=ps[i].x+ps[j].x, ty=ps[i].y+ps[j].y;
      if (!np.has(tx, ty)) {
	np.ins(tx, ty);
	if (count(tx, ty, n, ps, p)<=k) {
	  ans++;
	}
      }
    }
  }
  
  printf("%lld", ans);
  
  fclose(stdin);
  fclose(stdout);
  return 0;
}
